<template>
  <div>
    <homeTop :showicon1="false" :showicon2="true" :showbar6="true"></homeTop>
    <div class="main">
      <!-- 文字评价 -->
      <div class="textbox">
        <span class="gangshu">|</span>
        <span class="pingtext">文字评价</span>
        <van-field
          v-model="list.gopiongResults.content"
          placeholder="请输入你对医生的评价"
          label-align="top"
        />
      </div>
      <!-- 星级评价 -->
      <div class="starbox">
        <span class="gangshu">|</span>
        <span class="pingtext">星级评价</span>
        <p>
          <span style="float: left" class="docterzhuanye">医生专业度:</span>
          <van-rate
            v-model="list.gopiongResults.majorDegree"
            style="margin-top: 10px; padding-left: 10px"
          />
        </p>
        <p>
          <span style="float: left" class="docterzhuanyea">服务满意度:</span>
          <van-rate
            v-model="list.gopiongResults.satisfactionDegree"
            style="margin-top: 20px; padding-left: 10px"
          />
        </p>
      </div>
      <!-- 礼物 -->
      <div class="gritbox">
        <span class="gangshu">|</span>
        <span class="pingtext">送了礼物</span>
        <div>
          <img
            :src="list.gopiongResults.giftPicUrl"
            alt=""
            style="width: 25%; margin-left: 0.5rem"
          />
        </div>
      </div>
    </div>
  </div>
</template>
<script lang="ts" setup>
import homeTop from '../../components/homeTop/index.vue'
import { usecurrentStore } from '../../stores/Consultation'
import { onMounted } from 'vue'
import { useRoute } from 'vue-router'

const route = useRoute()

const { recordId } = route.query
const list: any = usecurrentStore()

onMounted(async () => {
  try {
    const userId = list.userId
    const sessionId = list.sessionId
    await list.aagogridData(userId, sessionId, Number(recordId))
    console.log(list.gopiongResults, '我的历史评价hahah')
  } catch (error) {
    console.error('加载失败', error)
  }
})
</script>
<style scoped lang="scss">
.main {
  flex: 1;
  //   background-color: #ece9e9;
  .textbox {
    width: 100%;
    height: 30%;
    background-color: #fff;
    margin-top: 20px;
    .gangshu {
      font-weight: 900;
      font-size: 25px;
      color: rgb(48, 135, 234);
      margin-left: 0.4rem;
    }
    .pingtext {
      font-size: 16px;
      padding-left: 10px;
    }
  }
  .starbox {
    width: 100%;
    height: 25%;
    background-color: #fff;
    margin-top: 30px;
    .gangshu {
      font-weight: 900;
      font-size: 25px;
      color: rgb(48, 135, 234);
      margin-left: 0.4rem;
    }
    .pingtext {
      font-size: 16px;
      padding-left: 10px;
    }
    .docterzhuanye {
      font-size: 14px;
      margin-left: 30px;
      margin-top: 10px;
    }
    .docterzhuanyea {
      font-size: 14px;
      margin-left: 30px;
      margin-top: 20px;
    }
  }
  .gritbox {
    width: 100%;
    height: 25%;
    background-color: #fff;
    margin-top: 30px;
    .gangshu {
      font-weight: 900;
      font-size: 25px;
      color: rgb(48, 135, 234);
      margin-left: 0.4rem;
    }
    .pingtext {
      font-size: 16px;
      padding-left: 10px;
    }
    .docterzhuanye {
      font-size: 14px;
      margin-left: 30px;
      margin-top: 10px;
    }
    .docterzhuanyea {
      font-size: 14px;
      margin-left: 30px;
      margin-top: 20px;
    }
  }
}
</style>
